import ajax from '@/common/js/ajax';

// 登录
export const login = (query, hideLoad) => ajax.post('/sys/login', query, hideLoad);

// 获取首页数据
export const getBusiness = (query, hideLoad) => ajax('/dashboard/business', query, hideLoad);

// 获取网点列表
export const getNetworkList = (query, hideLoad) => ajax('/business/network/list', query, hideLoad);

// 网点编辑
export const networkEdit = (query, hideLoad) => ajax.put('/business/network/edit', query, hideLoad);

// 获取网点下拉
export const getNetworkOptions = (query, hideLoad) => ajax('/business/network/listWithoutPage', query, hideLoad);

// 网点详情
export const networkDetails = (query, hideLoad) => ajax('/business/network/queryById', query, hideLoad);

// 网点信息
export const networkInfo = (query, hideLoad) => ajax('/business/network/queryDetailById', query, hideLoad);

// 获取机器列表
export const getDeviceList = (query, hideLoad) => ajax('/business/machine/list', query, hideLoad);

// 格子列表
export const getCellList = (query, hideLoad) => ajax('/business/machineCell/list', query, hideLoad);

// 占用格子用户信息
export const getCellOrder = (query, hideLoad) => ajax('/business/machineCell/getCellOrder', query, hideLoad);

// 开锁、全部开锁
export const openCellById = (query, hideLoad) => ajax.post('/business/machineCell/openCellById', query, hideLoad);

// 清柜、批量清柜
export const cleanCellById = (query, hideLoad) => ajax.post('/business/machineCell/cleanCellById', query, hideLoad);

// 修改柜子信息
export const editCell = (query, hideLoad) => ajax.put('/business/machineCell/edit', query, hideLoad);

// 设备详情
export const machineDetails = (query, hideLoad) => ajax('/business/machine/queryById', query, hideLoad)

// 更新APP
export const refreshApp = (query, hideLoad) => ajax('/business/machine/refreshApp', query, hideLoad);

// 重启设备
export const deviceRestart = (query, hideLoad) => ajax('/business/machine/reboot', query, hideLoad);

//字典标签专用（通过code获取字典数组）
export const initDictOptions = (code, query, hideLoad) => ajax(`/sys/dict/getDictItems/${code}`, query, hideLoad);

// 省市区联动
export const getAgentList = (query, hideLoad) => ajax('/base/address/getAgentList', query, hideLoad);

// 订单列表
export const getOrderList = (query, hideLoad) => ajax('/business/order/list', query, hideLoad);

// 关闭订单
export const closeOrder = (query, hideLoad) => ajax('/business/order/close', query, hideLoad);

// 订单详情
export const orderDetails = (query, hideLoad) => ajax('/business/order/queryOrderbyId', query, hideLoad);

// 资金流水
export const getCapitalFlowList = (query, hideLoad) => ajax('/business/capitalFlow/list', query, hideLoad);

// 提现管理
export const getWithdrawalList = (query, hideLoad) => ajax('/business/withdrawal/list', query, hideLoad);

// 用户提现
export const withdrawalAdd = (query, hideLoad) => ajax.post('/business/withdrawal/add', query, hideLoad);

// 提现详情
export const withdrawalDetails = (query, hideLoad) => ajax('/business/withdrawal/queryById', query, hideLoad);

// 用户信息
export const accountInfo = (query, hideLoad) => ajax('/sys/user/accountInfo', query, hideLoad);

// 用户列表
export const getUerList = (query, hideLoad) => ajax('/business/user/list', query, hideLoad);

// 拉黑用户
export const blackAdd = (query, hideLoad) => ajax.post('/business/blacklist/add', query, hideLoad);

// 恢复用户
export const blackDelete = (query, hideLoad) => ajax(`/business/blacklist/delete/${query.id}`, query, hideLoad);

// 修改密码
export const updatePassword = (query, hideLoad) => ajax.put('/sys/user/updatePassword', query, hideLoad);

// 业务统计
export const adminStatistics = (query, hideLoad) => ajax('/statistics', query, hideLoad);

// 格子查询状态
export const cellCheckStatus = (query, hideLoad) => ajax('/business/machineCell/status', query, hideLoad);

// 订单查询状态
export const orderCheckStatus = (query, hideLoad) => ajax('/business/machineCell/status', query, hideLoad);
